package com.system.AttendanceCherkDepartment.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.system.employee.entity.Employee;



@Entity
@Table(name="t_attendance")
public class Attendance {
	private Long id;
	//private Long empId;//员工id
	private AttendanceEvent attendanceEvent;//考勤事件类型
	private Date time;
	private Employee employee;
	private Long totalAbsence;//缺席次数
	private Long totalOvertime;//加班次数
	private Long totalLeave;//请假次数
	private Long totalVacation;//休假次数
	private Long totalscore=0L;//奖罚总计
	private Long salary=0L;//工资
	//get
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

//	public Long getEmpId() {
//		return empId;
//	}

	public AttendanceEvent getAttendanceEvent() {
		return attendanceEvent;
	}
	
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getTime() {
		return  time;
	}
	
	public Long getTotalAbsence() {
		return totalAbsence;
	}

	public Long getTotalOvertime() {
		return totalOvertime;
	}

	public Long getTotalLeave() {
		return totalLeave;
	}

	public Long getTotalVacation() {
		return totalVacation;
	}

	public Long getTotalscore() {
		return totalscore;
	}
	@ManyToOne(cascade=CascadeType.ALL)
	public Employee getEmployee() {
		return employee;
	}
	public Long getSalary() {
		return salary;
	}

	//set
	public void setId(Long id) {
		this.id = id;
	}
//	public void setEmpId(Long empId) {
//		this.empId = empId;
//	}
	
	public void setAttendanceEvent(AttendanceEvent attendanceEvent) {
		this.attendanceEvent = attendanceEvent;
	}
	
	public void setTime(Date time) {
		this.time = time;
	}

	public void setTotalAbsence(Long totalAbsence) {
		this.totalAbsence = totalAbsence;
	}

	public void setTotalOvertime(Long totalOvertime) {
		this.totalOvertime = totalOvertime;
	}

	public void setTotalLeave(Long totalLeave) {
		this.totalLeave = totalLeave;
	}

	public void setTotalVacation(Long totalVacation) {
		this.totalVacation = totalVacation;
	}

	public void setTotalscore(Long totalscore) {
		this.totalscore = totalscore;
	}
	public void setEmployee(Employee employee2) {
		this.employee = employee2;
	}

	public void setSalary(Long salary) {
		this.salary = salary;
	}

}
